<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div
      class="content-parent border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style10/Auxiliaryoutlinestyle5Bg.webp'})`,
      }"
    >
      <div class="audio-parent">
        <audioCom :info="props.info" ref="audioParent" />
      </div>

      <div class="content">
        <div class="title-box">
          <span>{{ props.info.text }}</span>
        </div>
        <div
          class="content-btm-1"
          v-if="
            !props.info.subTitle &&
            !props.info.remarks &&
            ((props.info.video && props.info.video.url) || props.info.value)
          "
        >
          <div v-if="(props.info.video && props.info.video.url) || props.info.value" class="img-box">
            <videoview
              @click="audioplay(false)"
              :info="props.info"
              v-if="props.info.video && props.info.video.url"
            ></videoview>
            <div v-else class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
        </div>
        <div
          class="content-btm"
          v-else
          :class="{ 'content-btm-2': !((props.info.video && props.info.video.url) || props.info.value) }"
        >
          <div class="content-btm-left">
            <p
              class="subtitle"
              :class="{
                subtitle2: !props.info.remarks && !((props.info.video && props.info.video.url) || props.info.value),
              }"
              v-if="props.info.subTitle"
            >
              {{ props.info.subTitle }}
            </p>

            <div
              class="remarks1"
              :class="{
                remarks4: ((props.info.video && props.info.video.url) || props.info.value) && !props.info.subTitle,
              }"
              v-if="((props.info.video && props.info.video.url) || props.info.value) && props.info.remarks"
            >
              <TextMax
                :color2="false"
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="4"
              ></TextMax>
            </div>
            <div class="remarks2" :class="{ remarks3: !props.info.subTitle }" v-else-if="props.info.remarks">
              <TextMax
                :color2="false"
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="props.info.subTitle ? 4 : 4"
              ></TextMax>
            </div>
          </div>
          <div v-if="(props.info.video && props.info.video.url) || props.info.value" class="img-box">
            <videoview
              @click="audioplay(false)"
              :info="props.info"
              v-if="props.info.video && props.info.video.url"
            ></videoview>
            <div v-else class="outline-cover">
              <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>



<script setup lang="ts">
import audioCom from './audioCom.vue';
import { publicUrls, textType } from '@/utils/minxin';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax10.vue';
import videoview from './../../../videoDialog/videoview.vue';

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

const ImgVisible = ref(false);
const audioRef = ref(null);
const audioParent = ref(null);
const videoRef = ref(null);
const isPlay = ref(false);
const store = useProjectStore();
const audioplay = (flag: boolean = true) => {
  audioParent.value.videoplay();
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  // align-items: flex-end;
  position: relative;
  margin-top: 0;
  height: 100%;
  margin-right: 140px;
}
.content-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 45px;
  width: 615px;
  height: 448px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-box-reflect: below 44% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.audio-parent {
  position: absolute;
  bottom: 0px;
  left: 100px;
  width: 82px;
  height: 60px;
}
.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 615px;
  height: 448px;
  padding: 36px 71px 90px 71px;
}
// .content2 {
//   // justify-content: center;
//   .title-box {
//     margin-top: calc(208px - 55px);
//   }
// }
// .content3 {
//   // justify-content: center;
//   .title-box {
//     margin-top: calc(192px - 55px);
//   }
//   .subtitle {
//     margin-top: 20px;
//   }
// }

.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 176px;
  height: 44px;

  span {
    text-align: center;
    width: 176px;
    font-family: SJxingkai-C;
    font-size: 22px;
    color: rgba(57, 56, 54, 1);
    line-height: 22px;
  }
}
.content-btm {
  display: flex;
  width: 100%;
  margin-top: 68px;
  .img-box {
    width: 200px;
    height: 200px;
    border-radius: 50%;
  }
}
.content-btm-2 {
  width: 393px;

  margin-top: 58px;
  .content-btm-left {
    margin-right: 0px !important;
    display: flex;
    justify-content: flex-start;
    margin-top: 0px;
    .remarks2 {
      margin-top: 10px;
      width: 100%;
    }
    .remarks3 {
      width: 100%;
      margin-top: 33px;
    }
  }
}

.content-btm-1 {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 58px;
  .img-box {
    width: 361px;
    height: 199px;
    img {
      object-fit: contain !important;
    }
  }
}
// GiEgy7ZZ
.content-btm-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  height: 194px;
  margin-right: 10px;
  margin-top: 3px;
}
.subtitle {
  width: 100%;
  font-family: PingFang SC;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  color: rgba(57, 56, 54, 1);
  text-align: center;
  font-weight: 500;
  letter-spacing: -1px; /* 字符间距为 5px */
}
.subtitle2 {
  margin-top: calc(129px - 68px) !important;
}
.img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;

  background: rgba(57, 56, 54, 0.1);
  :deep(video) {
    background: rgba(57, 56, 54, 0.1);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}

.remarks1 {
  margin-top: 10px;
  width: 100%;
}

.remarks2 {
  margin-top: 10px;
  width: 100%;
}
.remarks3 {
  width: 100%;
  margin-top: 0px;
}
.remarks4 {
  margin-top: 0px;
}
</style>
